import 'package:love_newf/generated/json/base/json_convert_content.dart';
import 'package:love_newf/app/com/model/room_prop_model.dart';

RoomPropModel $RoomPropModelFromJson(Map<String, dynamic> json) {
  final RoomPropModel roomPropModel = RoomPropModel();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    roomPropModel.id = id;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    roomPropModel.name = name;
  }
  final String? iconUrl = jsonConvert.convert<String>(json['iconUrl']);
  if (iconUrl != null) {
    roomPropModel.iconUrl = iconUrl;
  }
  final String? effectUrl = jsonConvert.convert<String>(json['effectUrl']);
  if (effectUrl != null) {
    roomPropModel.effectUrl = effectUrl;
  }
  final int? effectType = jsonConvert.convert<int>(json['effectType']);
  if (effectType != null) {
    roomPropModel.effectType = effectType;
  }
  final int? expireDay = jsonConvert.convert<int>(json['expireDay']);
  if (expireDay != null) {
    roomPropModel.expireDay = expireDay;
  }
  final int? rosePrice = jsonConvert.convert<int>(json['rosePrice']);
  if (rosePrice != null) {
    roomPropModel.rosePrice = rosePrice;
  }
  final int? action = jsonConvert.convert<int>(json['action']);
  if (action != null) {
    roomPropModel.action = action;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    roomPropModel.remark = remark;
  }
  final int? type = jsonConvert.convert<int>(json['type']);
  if (type != null) {
    roomPropModel.type = type;
  }
  final int? loversGrade = jsonConvert.convert<int>(json['loversGrade']);
  if (loversGrade != null) {
    roomPropModel.loversGrade = loversGrade;
  }
  final int? sell = jsonConvert.convert<int>(json['sell']);
  if (sell != null) {
    roomPropModel.sell = sell;
  }
  final int? orderSort = jsonConvert.convert<int>(json['orderSort']);
  if (orderSort != null) {
    roomPropModel.orderSort = orderSort;
  }
  final int? tag = jsonConvert.convert<int>(json['tag']);
  if (tag != null) {
    roomPropModel.tag = tag;
  }
  return roomPropModel;
}

Map<String, dynamic> $RoomPropModelToJson(RoomPropModel entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['name'] = entity.name;
  data['iconUrl'] = entity.iconUrl;
  data['effectUrl'] = entity.effectUrl;
  data['effectType'] = entity.effectType;
  data['expireDay'] = entity.expireDay;
  data['rosePrice'] = entity.rosePrice;
  data['action'] = entity.action;
  data['remark'] = entity.remark;
  data['type'] = entity.type;
  data['loversGrade'] = entity.loversGrade;
  data['sell'] = entity.sell;
  data['orderSort'] = entity.orderSort;
  data['tag'] = entity.tag;
  return data;
}

extension RoomPropModelExtension on RoomPropModel {
  RoomPropModel copyWith({
    int? id,
    String? name,
    String? iconUrl,
    String? effectUrl,
    int? effectType,
    int? expireDay,
    int? rosePrice,
    int? action,
    String? remark,
    int? type,
    int? loversGrade,
    int? sell,
    int? orderSort,
    int? tag,
  }) {
    return RoomPropModel()
      ..id = id ?? this.id
      ..name = name ?? this.name
      ..iconUrl = iconUrl ?? this.iconUrl
      ..effectUrl = effectUrl ?? this.effectUrl
      ..effectType = effectType ?? this.effectType
      ..expireDay = expireDay ?? this.expireDay
      ..rosePrice = rosePrice ?? this.rosePrice
      ..action = action ?? this.action
      ..remark = remark ?? this.remark
      ..type = type ?? this.type
      ..loversGrade = loversGrade ?? this.loversGrade
      ..sell = sell ?? this.sell
      ..orderSort = orderSort ?? this.orderSort
      ..tag = tag ?? this.tag;
  }
}